<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/mainstyle.css"/>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" href="./css/themes/base/jquery.ui.all.css">
	<script src="./js/jquery-1.6.2.min.js"></script>
<title>话务对接话单</title>
</head>

<script>

	
  
//页码导航 
function post_list(index,curpage,maxpage)
{ 
     if (parseInt(index) <= parseInt(maxpage) && parseInt(index) > 0  && parseInt(curpage)!= parseInt(index) )
	 {
        document.form1.action = '?action=list_cdr&curpage='+index+'&agent_id=<% $agent_id %>'; 
	    document.form1.submit(); 
	    return true;
	 }
	 return false;
}




function  change_acct_id(acct_id)
{
	    document.form1.submit(); 
	    return true;		 
	
}    
 </script>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                
                <td width="97%" valign="bottom"><span  align="left" class="table_caption">代理话单</span></td>
              </tr>
            </table></td>
            <td><div align="right"><span class="table_caption"></span>
             
             
             
             </div></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  
      <form name="form1" method="post" action="?action=list_cdr">
   <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
    
    
      <tr>
        <td><div align="left"><span class="STYLE6"><span class="STYLE1">代理商
                <select name="agent_id" class="STYLE1" id="agent_id" onchange= "change_acct_id(this.value)" >
                  <option  value="" > --全部-- </option>
                  <%foreach from=$acctchild item=eachone key=keyname %>
                  <option  value="<% $eachone.decode_id %>" <% if $eachone.decode_id eq $agent_id %> selected <%/if%> >
                    <% $eachone.acctname %>
                  </option>
                  <%/foreach%>
                </select>
                <label for="datetype">日期</label>
                <select name="years" class="STYLE1">
                  <option value="2010" <% if $post_data.years eq 2010 %>selected<%/if%>>2010</option>
                  <option value="2011" <% if $post_data.years eq 2011 %>selected<%/if%>>2011</option>
                  <option value="2012" <% if $post_data.years eq 2012 %>selected<%/if%>>2012</option>
                  <option value="2013" <% if $post_data.years eq 2013 %>selected<%/if%>>2013</option>
                  <option value="2014" <% if $post_data.years eq 2014 %>selected<%/if%>>2014</option>
                  <option value="2015" <% if $post_data.years eq 2015 %>selected<%/if%>>2015</option>
                  <option value="2016" <% if $post_data.years eq 2016 %>selected<%/if%>>2016</option>
                  <option value="2017" <% if $post_data.years eq 2017 %>selected<%/if%>>2017</option>
                  <option value="2018" <% if $post_data.years eq 2018 %>selected<%/if%>>2018</option>
                </select>
年
<select name="month" class="STYLE1">
  <option value="01" <% if $post_data.month eq "01" %>selected<%/if%>>01</option>
  <option value="02" <% if $post_data.month eq "02" %>selected<%/if%>>02</option>
  <option value="03" <% if $post_data.month eq "03" %>selected<%/if%>>03</option>
  <option value="04" <% if $post_data.month eq "04" %>selected<%/if%>>04</option>
  <option value="05" <% if $post_data.month eq "05" %>selected<%/if%>>05</option>
  <option value="06" <% if $post_data.month eq "06" %>selected<%/if%>>06</option>
  <option value="07" <% if $post_data.month eq "07" %>selected<%/if%>>07</option>
  <option value="08" <% if $post_data.month eq "08" %>selected<%/if%>>08</option>
  <option value="09" <% if $post_data.month eq "09" %>selected<%/if%>>09</option>
  <option value="10" <% if $post_data.month eq "10" %>selected<%/if%>>10</option>
  <option value="11" <% if $post_data.month eq "11" %>selected<%/if%>>11</option>
  <option value="12" <% if $post_data.month eq "12" %>selected<%/if%>>12</option>
</select>
月
<input id="begin_day" class="STYLE1" size = "1"  title="数字-起始天数" value="<% $post_data.begin_day %>" name="begin_day"  />
日-
<input id="end_day" class="STYLE1" size = "1"  title="数字-截至天数" value="<% $post_data.end_day %>"   name="end_day"  />
日
<% if $res_acct.accttype eq '1' %>
<label for="dstchannel">被叫IP</label>
<input name="dstchannel" type="text" class="STYLE1" id="dstchannel" size="12" maxlength="20" value='<% $post_data.dstchannel %>' />
<%/if%>
<label for="destination_number">被叫号码</label>
<input name="destination_number" type="text" class="STYLE1" id="destination_number" size="12" maxlength="30" value='<% $post_data.destination_number %>' />
<input name="querybtn" type="submit" class="STYLE1"   id="querybtn"  value=" 查询 " />
<input name="checkbox_downloadfile" type="checkbox" class="STYLE1"   />
<label for="downloadfile">导出</label>
        </span></span></div></td>
        </tr>
        
    </table></td>
  </tr>
    </form>
  
  
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
     <tr>
     <td width="2%"  height="24"    bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">序号</div></td>
     <td width="8%"  height="24"    bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">代理商</div></td>
     <td width="8%" height="24"    bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">主叫号码</div></td>
     <td width="8%" height="24"    bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">被叫号码</div></td>
     <td width="8%"  height="24"    bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">开始时间</div></td>
     <td width="4%"  height="24"    bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">接通时间</div></td>
     <td width="4%"  height="24"    bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">挂机时间</div></td>
     <td width="6%"  height="24"    bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">计费时长</div></td>
     <td width="6%" height="24"    bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">话费</div></td>
	 <% if $res_acct.accttype eq '1' %>
     <td width="8%" height="24"    bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">主叫IP</div></td>
     <td width="8%" height="24"    bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">被叫IP</div></td>
       
     <td width="6%" height="24"    bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title">中继成本</div></td>
     <% /if %>
                           
  </tr>     

          
          
          <% foreach from=$table_array item=eachone key=keyname %>  	
        <tr>
 <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE1"> <% $eachone.check_id %></div></td>
                          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
                              <% $eachone.accountcode %>
                            </div></td>
                            
                          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
                              <% $eachone.caller_id_number %>
                            </div></td>                       
                          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
                              <% $eachone.destination_number %>
                            </div></td>
                          
                          
                          
                          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
                              <% $eachone.start_stamp|date_format:"%y-%m-%d %T" %></div></td>
                              
                          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
                              <% $eachone.answer_stamp|date_format:"%T" %></div></td>
                              
                          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
                              <% $eachone.end_stamp|date_format:"%T" %></div></td>       
                              
                      <td height="18" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
                              <% $eachone.billsec %></div></td>       
                              
                              
                       <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
                              <% $eachone.costagent|string_format:"%.4f" %></div></td>    
					<% if $res_acct.accttype eq '1' %>   		     
                       <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
                              <% $eachone.channel %></div></td>   
                       <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
                              <% $eachone.dstchannel %></div></td>       

                        
                          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
                            <% $eachone.costgateway|string_format:"%.4f" %>
                          </div></td>
                          
                        <% /if %>
                               
                     
                           
           </tr>
          
 
        <% /foreach %>
    </table></td>
  </tr>
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="75%"><div align="left"><span class="STYLE21">共
                    <% $record_count %>
                    条记录， 总时长:<% $billsec %>秒, 总话费:<% $costagent|string_format:"%.2f" %>元   <% if $res_acct.accttype eq '1' %>   中继成本:<% $costgateway|string_format:"%.2f" %>元<% /if %> 当前第
                    <% $curpage %>
                    /
                    <% $maxpage %>
                    页，每页
                    <% $pagelimtcount %>
                    条记录
                    </span></div></td>
        <td width="25%"><table width="180" border="0" align="right" cellpadding="0" cellspacing="0">
          <tr>
            <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('1',<% $curpage %>,'<% $maxpage %>')"  >首页</a> </div></td>
            <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('<% $curpage-1 %>','<% $curpage %>','<% $maxpage %>')" >上一页</a></div></td>
            <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('<% $curpage+1 %>','<% $curpage %>','<% $maxpage %>')" >下一页</a></div></td>
            <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('<% $maxpage  %>' ,'<% $curpage %>','<% $maxpage %>')" >尾页</a></div></td>
           
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>

</body>

</html>
